/**
 * 
 */
package com.alkandros.linesmash.ui;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.alkandros.linesmash.R;

/**
 * @author Jiju Induchoodan
 *
 */
public class SplashActivity extends Activity {

	private Context context;
	protected int _splashTime = 5000;
	protected boolean _active = true;
	private  Thread splashTread ;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		intializeUI();
	}
	
	private void intializeUI() 
	{
		splashTread = new Thread() {
			@Override
			public void run() {
				try {
					int waited = 0;
					while (_active && (waited < _splashTime)) {
						sleep(100);
						if (_active) {
							waited += 100;
						}
					}
				} catch (InterruptedException e) {
				} finally {
					
					Intent i = new Intent(SplashActivity.this, StartPage.class);
					startActivity(i);
					finish();
				}
			}
		};
		splashTread.start();
	}

}
